package com.johnwharton.mtimemovie.application;

import android.app.Application;
import android.graphics.Bitmap;

import com.facebook.drawee.backends.pipeline.Fresco;
import com.squareup.picasso.Picasso;

/**
 * Created by My on 2016/8/20.
 */
public class MTimeApplication  extends Application {

    /**
     * 初始化框架
     */
    @Override
    public void onCreate() {
        super.onCreate();

        initPicasso();
        initFresco();
    }

    /**
     * 初始化Fresco框架
     */
    private void initFresco() {
        Fresco.initialize(this);
    }

    /**
     * 初始化picasso()框架
     */
    private void initPicasso() {
        Picasso.Builder builder = new Picasso.Builder(this)
                .defaultBitmapConfig(Bitmap.Config.RGB_565);
        Picasso picasso =  builder.build();
        Picasso.setSingletonInstance(picasso);
    }
}
